﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _575
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
        }
        private void button1_Click(object sender, EventArgs e)
        {

            string connstring = "Data Source=(local);Initial Catalog=练习;USER ID=USERCHI-591JOGO\\Administrator";
            SqlConnection connection = new SqlConnection(connstring);
            connection.Open();
            string sqlstring = "select * from student";
            SqlCommand mycom = new SqlCommand(sqlstring, connection);
            SqlDataAdapter adater = new SqlDataAdapter();
            adater.SelectCommand = mycom;
            DataSet SQLds = new DataSet();
            adater.Fill(SQLds);
            connection.Dispose();
            connection.Close();
            connection = null;
        }
        
    }
}
